
<h3>Data Types</h3>

Dumping complex structures

<pre>import json
print json.dumps(something)</pre>

<h4>Arrays (Lists)</h4>

Print array of strings:
<pre>print "\n".join(arr)</pre>

Iterating by index
<pre>for i in range(len(arr)):
  print arr[i]
</pre>

<h3>Standard Tasks</h3>

<h4>Read from Pipe</h4>

Line by line

<pre>proc = subprocess.Popen(['/bin/ls', 'something'],stdout=subprocess.PIPE)
while True:
  line = proc.stdout.readline()
  if line != '':
    do_something
  else:
    break
</pre>

Entire output at once

<pre>echo subprocess.check_output(['/bin/ls', 'something])</pre>

<h4>Parse JSON</h4>

<pre>import json
data = json.loads(json_string)</pre>
